package com.wizards.mtg;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.wizards.mtg.mana.Mana;
import com.wizards.mtg.zone.Graveyard;
import com.wizards.mtg.zone.Hand;

public class Player 
{
	private final List<Mana> manaPool;
	private final Graveyard graveyard;
	private final Hand hand;

	private List<Mana> manaToAdd;
	
	public Player() {
		this.manaPool = new ArrayList<Mana>();
		this.graveyard = new Graveyard(this);
		this.hand = new Hand(this);
	}
	
	public Player add(Mana mana)	   { manaToAdd = Arrays.asList(new Mana[]{ mana }); return this; }
	public Player add(List<Mana> mana) { manaToAdd = mana; return this; }
	public Player toManaPool()		   { manaPool.addAll(manaToAdd); manaToAdd = null; return this; }
	public Player clearManaPool() 	   { manaPool.clear(); return this; }

	public Graveyard getGraveyard() {
		return graveyard;
	}

	public Hand getHand() {
		return hand;
	}
}
